<%@ page contentType="text/html; charset=utf-8" %>

<%@ include file="/WEB-INF/jsp/includeTop.jsp" %>

<table width="100%" border="0" cellpadding="0" cellspacing="5">
  <tr>
    <td valign="top">
      <table class="dbborder" width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="bottom" class="blueTableBg">&nbsp;门店维护&nbsp;-&nbsp;门店信息变更</td>
        </tr>
        <tr>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="5">
              <tr>
                <td>
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="dashTopLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashTop" width=100%><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashTopRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td align="center">
                        <table width="100%" border="0" cellpadding="0" cellspacing="3">
                          <form:form target="tempFrame" commandName="channelInfoForm">
		                      <input type="hidden" name="updatekey" value="${usr.storeCode}">
		                      <input type="hidden" name="dataTypeCode" value="${usr.dataTypeCode}">
		                      <input type="hidden" name="dataToBeChanged" value="${usr.data}">
		                      <input type="hidden" id="updateType" name="updateType" value="0">
		                      <input type="hidden" id="userStepResultId" name="userStepResultId" value="${usr.id}">

                          <tr>
                            <td width="114" height="20" class="globalText">变更类型</td>
                            <td height="20" class="globalText">
			<c:if test="${usr.dataTypeCode == CODE_WF_STEP_TYPE_STORE_ADDRESS}">
				地址变更
			</c:if>
			<c:if test="${usr.dataTypeCode == CODE_WF_STEP_TYPE_CONTACT_NAME or usr.dataTypeCode == CODE_WF_STEP_TYPE_CONTACT_POSITION or usr.dataTypeCode == CODE_WF_STEP_TYPE_CONTACT_WAY}">
				联系人变更
			</c:if>
                            </td>
                          </tr>
                          <tr>
                            <td width="114" height="20" class="globalText">终端信息</td>
                            <td height="20" class="globalText">${usr.storeChannelName}</td>
                          </tr>
                          <tr>
                            <td width="114" height="20" class="globalText">提交人</td>
                            <td height="20" class="globalText">${usr.empName}</td>
                          </tr>
                          <tr>
                            <td width="114" height="20" class="globalText">提交日期</td>
                            <td height="20" class="globalText"><fmt:formatDate value="${usr.finishedAt}" pattern="yyyy-MM-dd"/></td>
                          </tr>
                          <tr>
                            <td width="114" height="20" class="globalText">变更内容</td>
                            <td height="20" class="globalText">${usr.data}</td>
                          </tr>
                          <tr>
                            <td align="center" colspan="2">
                              <table border="0" cellpadding="0" cellspacing="2">
                                <tr>
                                  <td><input type="button" class="btnStyle" value="返回" onclick="javascript:doReturn()"></td>
                                  <td><input type="button" class="btnStyle" value=" 更新主数据库 " onclick="javascript:doChange()"></td>
                                  <td><input type="button" class="btnStyle" value="作废" onclick="javascript:doDisable()"></td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          </form:form>
                        </table>
                      </td>
                      <td class="dashRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashBottomLeft"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashBottom" width=100%><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                      <td class="dashBottomRight"><img src="<c:url value='/images/spacer.gif' />" width="7" height="7"></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<script language="javascript">

	function doReturn() {
		window.location = "<c:url value='/admin/storeList.html' />";
	}

	function doChange() {
		if(confirm('确认更新吗?')){
			document.getElementById("channelInfoForm").action = "<c:url value='/admin/doStoreChangeDetail.html' />";
			document.getElementById("updateType").value = "0";
			document.getElementById("channelInfoForm").submit();
		}
	}

	function doDisable() {
		if(confirm('确认作废吗?')){
			document.getElementById("channelInfoForm").action = "<c:url value='/admin/doStoreChangeDetail.html' />";
			document.getElementById("updateType").value = "1";
			document.getElementById("channelInfoForm").submit();
		}
	}

	function submitCallbackSuccess(obj) {
		window.location="<c:url value='/admin/storeList.html' />";
	}

</script>
